package com.stockz.equity.indicator.vsa.pattern;

import java.util.List;

import org.springframework.stereotype.Component;

import com.stockz.equity.indicator.vsa.VsaBar;
import com.stockz.equity.indicator.vsa.property.Region;
import com.stockz.equity.indicator.vsa.property.Spread;
import com.stockz.equity.indicator.vsa.property.Type;
import com.stockz.equity.indicator.vsa.property.Volume;
import com.stockz.equity.model.Bar;

@Component
public class Accumulation extends VsaPattern {

	public Accumulation() {
		super("A", "Accumulation", VsaPatternType.Bullish);
	}

	@Override
	public void analyze(List<Bar> barList,List<VsaBar> vsaBarList, int index) {
		VsaBar vsaBar = vsaBarList.get(index);
		if(!Region.OverBaught.equals(vsaBar.getRegion())
				//&& !Close.Low.equals(vsaBar.getClose())    //Doubtfull
				&& !Spread.Wide.equals(vsaBar.getSpread())   //Doubtfull
				&& !Type.Down.equals(vsaBar.getType())
				&& (Volume.Climatic.equals(vsaBar.getVolume())
						|| Volume.UltraHigh.equals(vsaBar.getVolume()))){ 
			vsaBar.getVsaPatternList().add(this);			
		}
	}
}